package com.aaa.controller;


import com.aaa.entity.UMS_Menu;
import com.aaa.service.UMS_MenuService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("ums_menu")
public class UMS_MenuController {
    @Resource
    UMS_MenuService ums_menuService;

    @RequestMapping("list")
    public List<UMS_Menu> list() {
        return ums_menuService.list();
    }

    @RequestMapping("findPage")
    public List<UMS_Menu> findPage(@RequestParam(value = "page", defaultValue = "1") int page, @RequestParam(value = "size", defaultValue = "10") int size) {
        Page<UMS_Menu> paged = new Page<>(page, size);
        List<UMS_Menu> jobInfos = ums_menuService.selectUserPage(paged);
        return jobInfos;
    }

}
